# Contributor: Galen Abell <galen@galenabell.com>
# Maintainer: Galen Abell <galen@galenabell.com>
pkgname=py3-hjson
pkgver=3.0.2
pkgrel=4
pkgdesc="Hjson for Python"
url="https://github.com/hjson/hjson-py"
arch="noarch"
license="MIT"
depends="python3"
makedepends="py3-setuptools"
checkdepends="py3-pytest"
source="https://github.com/hjson/hjson-py/archive/v$pkgver/$pkgname-$pkgver.tar.gz
	fix-python-shebang.patch
	dont-depend-on-setuptools.patch
	"
builddir="$srcdir/hjson-py-$pkgver"

prepare() {
	default_prepare

	sed -i "s/^VERSION=.*/&'$pkgver'/" hjson/tool.py
}

build() {
	python3 setup.py build
}

check() {
	PYTHONPATH="." pytest
}

package() {
	python3 setup.py install --prefix=/usr --root="$pkgdir"

	rm -rf "$pkgdir"/usr/lib/python3*/site-packages/hjson/tests
	rm "$pkgdir"/usr/bin/hjson.cmd
}

sha512sums="
f08541b981797859e39356d65916fff4fe6ec11a7deb98bd03efbbe7f1a1ea93f8cc4881c4e9d225086b489483d3960f0ef1a30333d403eacb5674c6c11336c6  py3-hjson-3.0.2.tar.gz
6f4ed1c6a077ecf1f13751f0bb2ff1423ceb74a630eb90d2e29a8f3ab94d32462ac1c0222333d450002e73fc891a8033a538d9aea571d5f185c8fc7a89c8e79a  fix-python-shebang.patch
16840a1d019f3751cdea9aca1223cf26b3269b7da37e15f07bf62fdd92510c01afefb66b9d927eeb28de2004a786ffddf8b05e88d51bacda79d4a587205731e4  dont-depend-on-setuptools.patch
"
